// test002View.cpp : implementation of the Ctest002View class
//

#include "stdafx.h"
#include "test002.h"

#include "test002Doc.h"
#include "test002View.h"

#include "ImageProcess.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// Ctest002View

IMPLEMENT_DYNCREATE(Ctest002View, CView)

BEGIN_MESSAGE_MAP(Ctest002View, CView)
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CView::OnFilePrintPreview)
	ON_COMMAND(ID_HELP_TEST, &Ctest002View::OnHelpTest)
END_MESSAGE_MAP()

// Ctest002View construction/destruction

Ctest002View::Ctest002View()
{
	// TODO: add construction code here

}

Ctest002View::~Ctest002View()
{
}

BOOL Ctest002View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

// Ctest002View drawing

void Ctest002View::OnDraw(CDC* /*pDC*/)
{
	Ctest002Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	// TODO: add draw code for native data here
}


// Ctest002View printing

BOOL Ctest002View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void Ctest002View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void Ctest002View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}


// Ctest002View diagnostics

#ifdef _DEBUG
void Ctest002View::AssertValid() const
{
	CView::AssertValid();
}

void Ctest002View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

Ctest002Doc* Ctest002View::GetDocument() const // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Ctest002Doc)));
	return (Ctest002Doc*)m_pDocument;
}
#endif //_DEBUG


// Ctest002View message handlers

void Ctest002View::OnHelpTest()
{
	// TODO: Add your command handler code here
// 	RECT rect;
// 	GetClientRect(&rect);
// 	
//  	CImage image;
//  	image.Create(rect.right-rect.left, rect.bottom-rect.top, 32);
// 
//  	::PrintWindow(m_hWnd, image.GetDC(), PW_CLIENTONLY);

	CImage image;
	image.Load(_T("C:\\SnapPic\\old.bmp"));

	ResizeImage(image, /*936/2,579/2);//*/210, 130);


 
// 	image.Save(L"C:\\SnapPic\\1.bmp", Gdiplus::ImageFormatBMP);
 

}
